home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 79 / IOPROG_79.ISO / soft / C++ / MFaderDemo.exe / {app} / Effects.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2004-02-06  |  10.6 KB  |  336 lines

  1. VERSION 5.00
  2. Object = "{7CEC81AF-2003-4F1F-8AC2-E6D1FD8B2581}#1.0#0"; "MFADERDEMO.OCX"
  3. Begin VB.Form frmEffects 
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "Form1"
  6.    ClientHeight    =   7200
  7.    ClientLeft      =   0
  8.    ClientTop       =   0
  9.    ClientWidth     =   9600
  10.    DrawWidth       =   4
  11.    ForeColor       =   &H00000000&
  12.    Icon            =   "Effects.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    LockControls    =   -1  'True
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   480
  18.    ScaleMode       =   3  'Pixel
  19.    ScaleWidth      =   640
  20.    ShowInTaskbar   =   0   'False
  21.    StartUpPosition =   2  'CenterScreen
  22.    Begin MFaderDemo.MFader MFader1 
  23.       Height          =   6945
  24.       Left            =   75
  25.       TabIndex        =   15
  26.       Top             =   120
  27.       Width           =   6510
  28.       _ExtentX        =   11483
  29.       _ExtentY        =   12250
  30.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  31.          Name            =   "MS Sans Serif"
  32.          Size            =   8.25
  33.          Charset         =   178
  34.          Weight          =   400
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       FontName        =   "MS Sans Serif"
  40.       FontSize        =   8.25
  41.       ScaleHeight     =   463
  42.       ScaleWidth      =   434
  43.    End
  44.    Begin VB.Timer Timer1 
  45.       Interval        =   100
  46.       Left            =   7455
  47.       Top             =   4890
  48.    End
  49.    Begin VB.TextBox Text3 
  50.       Height          =   240
  51.       Left            =   8640
  52.       TabIndex        =   11
  53.       Text            =   "1"
  54.       Top             =   825
  55.       Width           =   855
  56.    End
  57.    Begin VB.TextBox Text2 
  58.       Height          =   240
  59.       Left            =   8640
  60.       TabIndex        =   9
  61.       Text            =   "1"
  62.       Top             =   495
  63.       Width           =   855
  64.    End
  65.    Begin VB.TextBox Text1 
  66.       Height          =   240
  67.       Left            =   8640
  68.       TabIndex        =   2
  69.       Text            =   "1"
  70.       Top             =   165
  71.       Width           =   855
  72.    End
  73.    Begin VB.CommandButton cmdGo 
  74.       Caption         =   "&Start Wiping"
  75.       Default         =   -1  'True
  76.       Height          =   495
  77.       Left            =   6705
  78.       TabIndex        =   8
  79.       Top             =   5880
  80.       Width           =   2775
  81.    End
  82.    Begin VB.CheckBox chkShowParentBack 
  83.       BackColor       =   &H00FFC0C0&
  84.       Caption         =   "Show Parent Background"
  85.       Height          =   195
  86.       Left            =   6720
  87.       TabIndex        =   7
  88.       Top             =   1650
  89.       Width           =   2340
  90.    End
  91.    Begin VB.CheckBox chkLoop 
  92.       BackColor       =   &H00FFC0C0&
  93.       Caption         =   "Continuous Wipping"
  94.       Height          =   195
  95.       Left            =   6720
  96.       TabIndex        =   6
  97.       Top             =   2025
  98.       Value           =   1  'Checked
  99.       Width           =   2340
  100.    End
  101.    Begin VB.ComboBox cmbEffects 
  102.       BeginProperty Font 
  103.          Name            =   "Small Fonts"
  104.          Size            =   6.75
  105.          Charset         =   178
  106.          Weight          =   400
  107.          Underline       =   0   'False
  108.          Italic          =   0   'False
  109.          Strikethrough   =   0   'False
  110.       EndProperty
  111.       ForeColor       =   &H00000000&
  112.       Height          =   285
  113.       ItemData        =   "Effects.frx":030A
  114.       Left            =   6705
  115.       List            =   "Effects.frx":046D
  116.       Style           =   2  'Dropdown List
  117.       TabIndex        =   5
  118.       Top             =   2565
  119.       Width           =   2805
  120.    End
  121.    Begin VB.CheckBox chkClear 
  122.       BackColor       =   &H00FFC0C0&
  123.       Caption         =   "Clear Picture Before Wipping"
  124.       Height          =   195
  125.       Left            =   6720
  126.       TabIndex        =   3
  127.       Top             =   1290
  128.       Width           =   2340
  129.    End
  130.    Begin VB.CommandButton cmdExit 
  131.       Cancel          =   -1  'True
  132.       Caption         =   "&Exit"
  133.       Height          =   495
  134.       Left            =   6705
  135.       TabIndex        =   0
  136.       Top             =   6600
  137.       Width           =   2775
  138.    End
  139.    Begin VB.Label Label2 
  140.       Alignment       =   2  'Center
  141.       BackStyle       =   0  'Transparent
  142.       Caption         =   "MFader by : Maher Farag www.ancientsoft.com"
  143.       BeginProperty Font 
  144.          Name            =   "Arial"
  145.          Size            =   11.25
  146.          Charset         =   178
  147.          Weight          =   700
  148.          Underline       =   0   'False
  149.          Italic          =   0   'False
  150.          Strikethrough   =   0   'False
  151.       EndProperty
  152.       ForeColor       =   &H00000000&
  153.       Height          =   720
  154.       Index           =   0
  155.       Left            =   6570
  156.       TabIndex        =   13
  157.       Top             =   3900
  158.       Width           =   3075
  159.    End
  160.    Begin VB.Label Label1 
  161.       BackStyle       =   0  'Transparent
  162.       Caption         =   "Delay After Effect (in ms)"
  163.       ForeColor       =   &H00FFFFFF&
  164.       Height          =   240
  165.       Index           =   3
  166.       Left            =   6720
  167.       TabIndex        =   12
  168.       Top             =   855
  169.       Width           =   2055
  170.    End
  171.    Begin VB.Label Label1 
  172.       BackStyle       =   0  'Transparent
  173.       Caption         =   "Draw width (1-50)"
  174.       ForeColor       =   &H00FFFFFF&
  175.       Height          =   240
  176.       Index           =   2
  177.       Left            =   6720
  178.       TabIndex        =   10
  179.       Top             =   525
  180.       Width           =   1680
  181.    End
  182.    Begin VB.Label Label1 
  183.       BackColor       =   &H0000C000&
  184.       BackStyle       =   0  'Transparent
  185.       Caption         =   "Effect :"
  186.       BeginProperty Font 
  187.          Name            =   "MS Sans Serif"
  188.          Size            =   8.25
  189.          Charset         =   178
  190.          Weight          =   700
  191.          Underline       =   0   'False
  192.          Italic          =   0   'False
  193.          Strikethrough   =   0   'False
  194.       EndProperty
  195.       ForeColor       =   &H008080FF&
  196.       Height          =   240
  197.       Index           =   1
  198.       Left            =   6720
  199.       TabIndex        =   4
  200.       Top             =   2340
  201.       Width           =   2055
  202.    End
  203.    Begin VB.Label Label1 
  204.       BackStyle       =   0  'Transparent
  205.       Caption         =   "Speed of Effect (1-50)"
  206.       ForeColor       =   &H00FFFFFF&
  207.       Height          =   240
  208.       Index           =   0
  209.       Left            =   6720
  210.       TabIndex        =   1
  211.       Top             =   195
  212.       Width           =   1680
  213.    End
  214.    Begin VB.Label Label2 
  215.       Alignment       =   2  'Center
  216.       BackStyle       =   0  'Transparent
  217.       Caption         =   "MFader by : Maher Farag www.ancentsoft.com"
  218.       BeginProperty Font 
  219.          Name            =   "Arial"
  220.          Size            =   11.25
  221.          Charset         =   178
  222.          Weight          =   700
  223.          Underline       =   0   'False
  224.          Italic          =   0   'False
  225.          Strikethrough   =   0   'False
  226.       EndProperty
  227.       ForeColor       =   &H00FFFFFF&
  228.       Height          =   720
  229.       Index           =   1
  230.       Left            =   6585
  231.       TabIndex        =   14
  232.       Top             =   3915
  233.       Width           =   3075
  234.    End
  235. Attribute VB_Name = "frmEffects"
  236. Attribute VB_GlobalNameSpace = False
  237. Attribute VB_Creatable = False
  238. Attribute VB_PredeclaredId = True
  239. Attribute VB_Exposed = False
  240. '******************************************
  241. '*  MFader ActiveX control Ver 1.2        *
  242. '*  Written By  : Maher Fahmy Farag       *
  243. '*                                        *
  244. '*  Purchase    : www.ancientsoft.com *
  245. '*                                        *
  246. '*  Enjoy the 115 Fading effects          *
  247. '******************************************
  248. ' Variable to hold the maximume number of pictures being loaded
  249. Private MaxPicNum As Long
  250. Private Sub chkClear_click()
  251. 'CLS for MFader
  252. MFader1.ClearBeforeFade = chkClear.Value
  253. End Sub
  254. Private Sub chkShowParentBack_Click()
  255. 'Simulate Transparent effect if Checked
  256. 'else better for SlideShow
  257. MFader1.ShowBackground = chkShowParentBack.Value
  258. End Sub
  259. Private Sub cmbEffects_Click()
  260. ' apply the selected effect from Effects ComboBox
  261. MFader1.Effect = cmbEffects.ListIndex
  262. End Sub
  263. Private Sub cmdGo_Click()
  264. Timer1.Enabled = False
  265. 'Ready to run
  266. MFader1.StopIt = False
  267. 'I choosed 640X480 resolution!!!!
  268. MFader1.Move 0, 0, 640, 480
  269. 'img Holds the Picture name I named 'em 1,2,3.bmp and so on
  270. 'just to for example
  271. img = 1
  272. MaxPicNum = 2
  273. 'Start SlideShow
  274.     If Not MFader1.StopIt Then
  275.         'Set the Loaded picture to MFader control
  276.         Set MFader1.Picture = LoadPicture(App.Path & "\Images\" & Trim(Str(img)) + ".bmp")
  277.         'Point to the next Slide (Picture)
  278.         img = img + 1
  279.         
  280.         If img > MaxPicNum Then img = 1
  281.         'Amazing
  282.         MFader1.Go
  283.     End If
  284.     'If the user need no continuous fading then exit loop
  285.     If Not chkLoop.Value = vbChecked Then Exit Do
  286.     'Give the processor time to handle other apps
  287.     DoEvents
  288. End Sub
  289. Private Sub cmdExit_Click()
  290. Unload Me
  291. 'Good programming habit
  292. Set frmEffects = Nothing
  293. End Sub
  294. Private Sub Form_Activate()
  295. 'Sequence is the default effect
  296. cmbEffects.ListIndex = 0
  297. 'Initialize MFader properties according to on form controls
  298. MFader1.Effect = Sequence
  299. MFader1.ClearBeforeFade = chkClear.Value
  300. MFader1.ShowBackground = chkShowParentBack.Value
  301. MFader1.FadingSpeed = Text1
  302. MFader1.DrawWidth = Text2
  303. MFader1.DelayAfterEffect = Text3
  304. 'Set the form background (MFader Parent or container)
  305. frmEffects.Picture = LoadPicture(App.Path & "\Images\Back.bmp")
  306. End Sub
  307. Private Sub Text1_LostFocus()
  308. If Text1 > 50 Then Text1 = 50
  309. If Text1 < 1 Then Text1 = 1
  310. MFader1.FadingSpeed = Text1
  311. chkLoop.Value = vbUnchecked
  312. End Sub
  313. Private Sub Text2_LostFocus()
  314. If Text2 > 1000 Then Text2 = 1000
  315. If Text2 < 1 Then Text2 = 1
  316. MFader1.DrawWidth = Text2
  317. End Sub
  318. Private Sub Text3_LostFocus()
  319. 'Delay in Milliseconds SO 1000 = ONE seconds
  320. If Text3 > 1000000 Then Text3 = 1000000
  321. If Text3 < 1 Then Text3 = 1
  322. MFader1.DelayAfterEffect = Text3
  323. End Sub
  324. Private Sub MFader1_Click()
  325. 'The user need to stop the fading process
  326. MFader1.StopIt = True
  327. Timer1.Enabled = True
  328. 'Restore Fader control wdith & height
  329. 'to make other control appear
  330. MFader1.Width = 440
  331. MFader1.Height = 480
  332. End Sub
  333. Private Sub Timer1_Timer()
  334. Label2(0).ForeColor = RGB(Rnd(1) * 255, 0, 0)
  335. End Sub
  336.